﻿using System.Collections.Generic;
using Engine;
using Game;

namespace Mekiasm
{
    public class RubberWood : ItemCube
    {
        public static int Index;
        public RubberWood() : base("橡胶原木")
        {
            
            
        }
        public override int GetFaceTextureSlot(int face, int value)
        {
            int extraData = ILibrary.getExtraData(value);
            extraData -= 1;
            if (face == 4 || face == 5) return 224;
            if (face == extraData) return 226;
            else return 225;
        }
        public override bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value)
        {
            return false;
        }
        public override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List<BlockDropValue> dropValues, out bool showDebris)
        {
            showDebris = false;
            dropValues.Add(new BlockDropValue() { Count = 1, Value = Index });
        }
        public override void GenerateTerrainVertices(Block block, BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
        {
            switch (ILibrary.getExtraData(value))
            {
                case 4:
                    generator.GenerateCubeVertices(block, value, x, y, z, Color.White, geometry.GetGeometry(ILibrary.texture).OpaqueSubsetsByFace);
                    break;
                case 0:
                    generator.GenerateCubeVertices(block, value, x, y, z, 1, 0, 0, Color.White, geometry.GetGeometry(ILibrary.texture).OpaqueSubsetsByFace);
                    break;
                default:
                    generator.GenerateCubeVertices(block, value, x, y, z, 0, 1, 1, Color.White, geometry.GetGeometry(ILibrary.texture).OpaqueSubsetsByFace);
                    break;
            }
        }

    }
}
